how to handle exceptions in component render methods